home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 1 / Meeting Pearls Vol 1 (1994).iso / installed_progs / text / faqs / oberon-faq.language < prev    next >
Encoding:
Internet Message Format  |  1994-04-09  |  10.1 KB

  1. Subject: Comp.lang.oberon FAQ (monthly)
  2. Newsgroups: comp.lang.oberon,comp.answers,news.answers
  3. From: mikeg@psg.com (Mike Gallo)
  4. Date: Fri, 8 Apr 1994 12:05:45 GMT
  5.  
  6. Archive-name: Oberon-FAQ/language
  7.  
  8.      (*  * *  * *  * *  * *  * *  * *  * *  * *  * *  * *  *)
  9.  
  10.      Many FAQ lists, including this one, are available by anonymous
  11. ftp from rtfm.mit.edu in the /pub/usenet/news-answers directory.  
  12.      Thanks to all who have contributed!  Further additions,
  13. corrections, and suggestions are welcome.
  14.  
  15. mikeg@psg.com
  16.  
  17.      (*  * *  * *  * *  * *  * *  * *  * *  * *  * *  * *  *)
  18.  
  19. Comp.lang.oberon Frequently Asked Questions
  20. The Programming Language
  21.  
  22.  
  23. Copyright 1994 Michael Gallo
  24. (c) 1994 Michael Gallo
  25.  
  26.  
  27. THE PROGRAMMING LANGUAGE OBERON 
  28.  
  29. From "From Modula to Oberon"
  30.  
  31.           The programming language Oberon is the result of a
  32.      concentrated effort to increase the power of Modula-2 and
  33.      simultaneously to reduce its complexity. Several features were
  34.      eliminated, and a few were added in order to increase the
  35.      expressive power and flexibility of the language. This paper
  36.      describes and motivates the changes. The language is defined
  37.      in a concise report.
  38.           Whereas modern languages, such as Modula, support the
  39.      notion of extensibility in the procedural realm, the notion is
  40.      less well established in the domain of data types. In
  41.      particular, Modula does not allow the definition of new data
  42.      types as extensions of other, programmer-defined types in an
  43.      adequate manner. An additional feature was called for, thereby
  44.      giving rise to an extension of Modula.
  45.           . . . .
  46.           The evolution of a new language that is smaller, yet more
  47.      powerful than its ancestor is contrary to common practices and
  48.      trends, but has inestimable advantages. Apart from simpler
  49.      compilers, it results in a concise defining document, an
  50.      indispensable prerequisite for any tool that must serve in the
  51.      construction of sophisticated and reliable systems.
  52.  
  53.      Among the eliminations in the move from Modula-2 to Oberon are
  54. variant records, opaque types, enumeration types, subrange types,
  55. the basic type CARDINAL, local modules, and Modula's WITH
  56. statement.  The major addition to Oberon is the concept of type
  57. extension (i.e., single inheritance) for records.
  58.  
  59.  
  60. OBJECT ORIENTED PROGRAMMING IN OBERON
  61.  
  62.      Oberon does not offer multiple inheritance.  However, it has
  63. been shown that multiple inheritance can be efficiently implemented
  64. in terms of single inheritance and been argued that MI is therefore
  65. syntactic sugar that is rarely used in practice.  For details, see
  66. Templ (1993) and Mssenbck (1993).
  67.      Oberon does not offer built in "methods" as do many other
  68. languages supporting OOP.  Instead, conventional virtual methods
  69. can easily be implemented by a pointer to a procedure table, or
  70. "messages" can be sent to procedures as extensible records.
  71.      While some people complain about Oberon's minimalistic support
  72. of object oriented programming, others feel that this is one of
  73. Oberon's strengths, that the language does not institutionalize a
  74. particular approach to OOP (see the Comp.object FAQ list for an
  75. examination of several variations on the object oriented paradigm). 
  76. For another discussion, see Oberon2.OOP by H. Mssenbck.  
  77.  
  78.  
  79. THE PROGRAMMING LANGUAGE OBERON-2
  80.  
  81. From "Differences between Oberon and Oberon-2"
  82.  
  83.           Oberon-2 is a true extension of Oberon. . . .
  84.           One important goal for Oberon-2 was to make object-
  85.      oriented programming easier without sacrificing the conceptual
  86.      simplicity of Oberon. After three years of using Oberon and
  87.      its experimental offspring Object Oberon we merged our
  88.      experiences into a single refined version of Oberon.
  89.           The new features of Oberon-2 are type-bound procedures
  90.      [i.e., virtual methods], read-only export of variables and
  91.      record fields, open arrays as pointer base types, and a with
  92.      statement with variants. The for statement is reintroduced
  93.      after having been eliminated in the step from Modula-2 to
  94.      Oberon.
  95.  
  96.  
  97. THE "OBERON FAMILY" OF LANGUAGES
  98.  
  99.      Object Oberon is a now defunct, experimental extension of
  100. Oberon featuring "classes", structures somewhere between modules
  101. and records.  It evolved into Oberon-2.
  102.      Seneca was also an experimental extension of Oberon.  It
  103. focused on numerical programming on vector computer architectures. 
  104. It evolved into Oberon-V.
  105.      Oberon-V is an experimental dialect (but not a superset) of
  106. Oberon.  It is concerned with issues of numerical computing, array
  107. processing, and code verification.  It's primary new features are
  108. the ALL statement (a parallel version of the FOR loop) and array
  109. constructors for actual open array parameters.  Since it was
  110. originally aimed at vector architectures in general and the Cray Y-
  111. MP in particular, no Oberon-V compiler has yet been implemented for
  112. the Oberon System.  For details, see Griesemer (1993).
  113.  
  114.  
  115. COMMON PROBLEMS PROGRAMMING IN OBERON
  116.  
  117. The WITH statement
  118.  
  119. "This [compiler error] has to be a bug, correct me if I'm wrong!
  120. (I'm going nuts over this)"
  121.  
  122.      TYPE
  123.         Obj* = POINTER TO Empty;
  124.         Empty = RECORD (*nothing*) END;
  125.  
  126.         OpObj = POINTER TO OpNode;
  127.         OpNode = RECORD (Empty)
  128.            name : CHAR;
  129.            left, right : Obj;
  130.         END;
  131.  
  132.      PROCEDURE doeval(ex: Obj): REAL;
  133.      BEGIN
  134.         WITH ex : OpObj DO
  135.            CASE ex.name OF
  136.               "+" : RETURN doeval(ex.left) + doeval(ex.right);
  137.               (* clever code here *)
  138.            END;
  139.            (* more clever code here *)
  140.         END;
  141.      END doeval;
  142.  
  143. As thutt@clark.net (Taylor Hutt) points out,
  144.      . . . this is not a bug.  The WITH statement actually changes
  145.      the static type of the WITHed variable for the entire duration
  146.      of the WITH statement.
  147.           A workaround to this problem is to assign the parameter
  148.      to a temporary variable and to use the WITH on the temp.  A
  149.      type guard will not work properly in this case, do not attempt
  150.      to use it.
  151.  
  152.      Some people on Comp.lang.oberon think that because of its non-
  153. local effects, the WITH statement should be avoided entirely.  They
  154. point out that a programmer can use individual type guards or, if
  155. a guarded variable is used very many times, pass the variable to a
  156. procedure.
  157.  
  158.  
  159. BIBLIOGRAPHY
  160.  
  161.      Sources cited in the FAQ list that are not listed in the
  162. bibliography are electronically available in PostScript and/or
  163. Oberon text formats from ETH Zrich.  They can be acquired by
  164. anonymous ftp from:
  165.  
  166.      ftp.inf.ethz.ch:/Oberon,
  167.      wuarchive.wustl.edu:/languages/Oberon, and
  168.      gatekeeper@dec.com:/pub/plan/Oberon
  169.  
  170. "Type Extensions" by N. Wirth; ACM Transactions on Programming
  171. Languages and Systems; 10, 2 (April 1988) 204-214.
  172.  
  173. "From Modula to Oberon" by N. Wirth; Software: Practice and
  174. Experience; 18,7 (July 1988) 661-670.
  175.  
  176. "The Programming Language Oberon" by N. Wirth; Software: Practice
  177. and Experience; 18,7 (July 1988) 671-690.
  178.  
  179. "Variations on the Role of Module Interfaces" by J. Gutknecht;
  180. Structured Programming; 10,1 (January 1989) 40-46.
  181.  
  182. "Object Oberon -- A Modest Object-Oriented Language" by H.
  183. Mssenbck and J. Templ; Structured Programming; 10,4 (April 1989)
  184. 199-207.
  185.  
  186. A New Approach to Formal Language Definition and Its Application to
  187. Oberon by M. Odersky; Verlag der Fachvereine Zrich; 1989.
  188.  
  189. "The Programming Language Oberon-2" by H. Mssenbck and N. Wirth;
  190. Structured Programming; 12,4 (April 1991).
  191.  
  192. Programming in Oberon: Steps Beyond Pascal and Modula-2 by M.
  193. Reiser and N. Wirth; ACM Press; 1992.
  194.  
  195. "A Systematic Approach to Multiple Inheritance Implementation" by
  196. J. Templ; ACM SIGPLAN Notices; Volume 28, Number 4 (April 1993).
  197.  
  198. Object Oriented Programming in Oberon-2 by H. Mssenbck; Springer-
  199. Verlag; 1993.
  200.  
  201. A Programming Language for Vector Computers by R. Griesemer; Swiss
  202. Federal Institute of Technology (ETH Zrich); Dissertation Number
  203. 10277, 1993.
  204.  
  205.  
  206. OBERON COMPILERS
  207.  
  208.      Please note that mention of a product or company does not
  209. necessarily imply a recommendation.  For Oberon compilers developed
  210. outside ETH Zrich contact:
  211.  
  212. VAX/VMS:
  213.      ModulaWare GmbH, Wilhelmstr. 17A, D-91054 Erlangen/F.R.Germany
  214.           Modula-2 & Oberon-2 Compiler Manufactur
  215.           Tel. +49 (9131) 208395, Fax +49 (9131) 28205.
  216.           E-mail/Internet:
  217.                100023.2527@compuserve.com
  218.                g_dotzel@ame.nbg.sub.org
  219.  
  220. MS-DOS and Windows:
  221.      ModulaWare GmbH, Wilhelmstr. 17A, D-91054 Erlangen/F.R.Germany
  222.           OM2 32 Bit Oberon-2 and Modula-2 Compiler for PC/DOS
  223.           '386/'486 native code for DOS with DPMI Driver/Host and
  224.           for DOS sessions under Windows 3.1 and OS/2 2.1
  225.      COP2 (partial Oberon to C translator)
  226.           contact Taylor Hutt, e-mail: thutt@clark.net
  227.      Oberon-M
  228.           contact E. Videki, e-mail: erv@k2.everest.tandem.com
  229.      Extacy
  230.           Real Time Associates Ltd.
  231.           Canning House, 59 Canning Road
  232.           Croydon, Surrey, CRO 6QF
  233.           England
  234.           Tel.: 0044-81-656 7333
  235.           Fax: 0044-81-655 0401
  236.           E-mail: 71333.2346@compuserve.com
  237.                rta@rtal.demon.co.uk
  238.      Pow! (Programmers Oberon Workbench)
  239.           It works with Microsoft Windows and can be used to create
  240.           native Windows applications (EXE's and DLL's).
  241.           Ftp: ftp.fim.uni-linz.ac.at:/pub/soft/pow-oberon2, or
  242.           galileo.meakins.mcgill.ca:/Oberon/CommercialDemos/POW
  243.           E-mail: pow@fim.uni-linz.ac.at
  244.           Mailing list: majordomo@fim.uni-linz.ac.at "subscribe
  245.           pow-list"
  246.  
  247. Amiga:
  248.      A+L AG
  249.           Daederiz 61
  250.           CH-2540 Grenchen
  251.           Tel.: +41 (65) 52 03 11
  252.  
  253. DECstation (Ultrix, OSF/1), Intel386 (SVR4, OS2, Solaris), Sparc
  254. (Solaris):
  255.      Office of Commercial Services
  256.           Queensland University of Technology
  257.           GPO box 2434, Brisbane Q4001
  258.           Australia
  259.  
  260. Atari:
  261.      Martin Momberg
  262.           Hahlgartenstr. 13a
  263.           D-64331 Weiterstadt
  264.           Germany
  265.           E-Mail: Inet:momberg@dik.maschinenbau.th-darmstadt.de
  266.           Ftp: ftp.th-darmstadt.de:
  267.                /pub/machines/atari/programming/stoberon
  268. -- 
  269. A designer knows he has arrived at perfection not when there 
  270. is no longer anything to add, but when there is no longer 
  271. anything to take away.
  272.                 -- Antoine de Saint-Exupery
  273.  
  274.